package com.dreamlin.basepro.base.viewmodel;

public class LoadingModel {

    private boolean isShow;
    private String message;
    private static volatile LoadingModel showInstance;
    private static volatile LoadingModel hideInstance;

    public LoadingModel(boolean isShow, String message) {
        this.isShow = isShow;
        this.message = message;
    }

    public boolean isShow() {
        return isShow;
    }

    public void setShow(boolean show) {
        isShow = show;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static LoadingModel getHideInstance() {
        if (hideInstance == null) {
            synchronized (LoadingModel.class) {
                if (hideInstance == null) {
                    hideInstance = new LoadingModel(false, "");
                }
            }
        }
        return hideInstance;
    }

    public static LoadingModel getShowInstance() {
        if (showInstance == null) {
            synchronized (LoadingModel.class) {
                if (showInstance == null) {
                    showInstance = new LoadingModel(true, "数据加载中...");
                }
            }
        }
        return showInstance;
    }
}
